package com.masiyi.servlet;

import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpSession;

import java.io.IOException;
import java.io.PrintWriter;

/**
 * @Author masiyi
 * @Date 2023/12/18
 * @PackageName:com.masiyi.servlet
 * @ClassName: MySession
 * @Description: TODO
 * @Version 1.0
 */
@WebServlet(urlPatterns = "/mySession")
public class MySession2 extends MySession {

    /**
     * @param req
     * @param resp
     * @throws ServletException
     * @throws IOException
     */
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        HttpSession session = req.getSession();
        session.setAttribute("name","masiyi");
        super.doGet(req, resp);
    }
}
